using micromsg;
using MicroMsg.Common.Event;
using MicroMsg.Common.Utils;
using MicroMsg.Network;
using MicroMsg.Protocol;
using MicroMsg.Scene;
using System;
namespace MicroMsg.Plugin.Shake.Scene
{
	public class NetSceneShakeTranImgReport : NetSceneBaseEx<ShakeTranImgReportRequest, ShakeTranImgReportResponse, ShakeTranImgReportRequest.Builder>
	{
		private const string TAG = "NetSceneShakeTranImgReport";
		public bool doScene()
		{
			Log.smethod_4("NetSceneShakeTranImgReport", "doscene in");
			base.beginBuilder();
			this.mBuilder.BaseRequest = NetSceneBase.makeBaseRequest(0);
			this.mSessionPack.mCmdID = 127;
			base.endBuilder();
			return true;
		}
		protected override void onFailed(ShakeTranImgReportRequest request, ShakeTranImgReportResponse response)
		{
			PackResult lastError = base.getLastError();
			Log.smethod_4("NetSceneShakeTranImgReport", "onFailed in PackResult =" + lastError);
			if (lastError == PackResult.BEEN_CANCELLED)
			{
				return;
			}
			EventCenter.postEvent(EventConst.ON_NETSCENE_SHAKE_ERR, null, null);
		}
		protected override void onSuccess(ShakeTranImgReportRequest request, ShakeTranImgReportResponse response)
		{
			Log.smethod_4("NetSceneShakeTranImgReport", "onSuccess in");
			RetConst ret = (RetConst)response.BaseResponse.Ret;
			if (ret != RetConst.MM_OK)
			{
				EventCenter.postEvent(EventConst.ON_NETSCENE_SHAKE_ERR, null, null);
				return;
			}
			ShakeService.delayToExec(4, delegate
			{
				new NetSceneShakeTranImgGet().doScene(response.Buffer);
			});
		}
	}
}
